<?php
function __autoload($className)
{
	$classFile = str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php';
	require_once $classFile;
}

$cat1 = new \App\Animal\Cat('小黄猫', '黄', 20);
$cat2 = new \App\Animal\Cat('Tom猫', '蓝', 30);
$fish1 = new \App\Animal\Fish('Jack鱼', '红');
$dog1 = new \App\Animal\Dog('旺财', '黄');
$fish2 = new \App\Animal\Fish('Mary鱼', '黑');

$zoo = new \App\Zoo();
$zoo->addAnimal($cat1);
$zoo->addAnimal($cat2);
$zoo->addAnimal($fish1);
$zoo->addAnimal($dog1);
$zoo->addAnimal($fish2);

$zoo->watch();
$zoo->kill();

//$fish1 = new \App\Animal\Fish('Jack鱼', '黑');
//$fish2 = new \App\Animal\Fish('Mary鱼', '红');
//$s = new \App\Vehicle\Submarine('U551号', '黑');
//
//// Swimable类型的元素组成的数组
//$arr = [$fish1, $s, $fish2];
//foreach ($arr as $e) {
//    if ($e instanceof \App\Swimable) {
//        $e->swim();
//    }
//}
